package com.my.java.design_mode.producerconsumer;

/**
 * 消费者线程，负责消费公共资源
 */
public class ConsumerThread implements Runnable {
	private PublicResource resource;

	public ConsumerThread(PublicResource resource) {
		this.resource = resource;
	}

	public void run() {
		for (int i = 0; i < 10; i++) {
			resource.decreace();
		}
	}
}
